package com.example.order.remote.fallback;

import com.example.common.enums.ResultCode;
import com.example.common.req.payment.PaymentReq;
import com.example.common.resp.GlobalResult;
import com.example.common.resp.payment.PaymentResp;
import com.example.order.remote.PaymentService;
import org.springframework.stereotype.Component;

@Component
public class PaymentFallbackService implements PaymentService {

    @Override
    public GlobalResult<Long> create(PaymentReq payment) {
        return GlobalResult.error(ResultCode.SYS_BUSY.getCode(),
                "Service Order System is busy, please try again later");
    }

    @Override
    public GlobalResult<PaymentResp> get(Long id) {
        return GlobalResult.error(ResultCode.SYS_BUSY.getCode(),
                "Service Order System is busy, please try again later");
    }

    @Override
    public GlobalResult<String> success() {
        return GlobalResult.error(ResultCode.SYS_BUSY.getCode(),
                "Service Order System is busy, please try again later");
    }

    @Override
    public GlobalResult<String> timeout() {
        return GlobalResult.error(ResultCode.SYS_BUSY.getCode(),
                "Service Order System is busy, please try again later");
    }
}
